﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Configuration;

namespace HotelManagement.DL.Helper
{
    public static class DBHelperFactory
    {
        public static DBHelper m_DBHelperInstance = null;

        public static DBHelper createDBHelper() 
        {
            if (m_DBHelperInstance == null)
            {
                string strDbType = Properties.Settings.Default.DBType.ToString();                
                if (strDbType.Equals("ACCESS"))
                {
                    m_DBHelperInstance = new AccessDBHelper(ConnectionManager.CreateConnection());
                }
                else if (strDbType.Equals("SQLSERVER"))
                {
                    m_DBHelperInstance = new SqlDBHelper();
                }
            }
            return m_DBHelperInstance;
        }
    }
}
